import { BaseEntity, Column, Entity, PrimaryGeneratedColumn } from 'typeorm'

// name参数是使用的表名称
@Entity({ name: 'user' })
export class User extends BaseEntity {
  // 自增主键
  @PrimaryGeneratedColumn({ type: 'int', name: 'id' })
  id: number
  // 用户名
  @Column({
    type: 'varchar',
    name: 'userName',
  })

  // 密码
  userName: string
  @Column({
    type: 'varchar',
    name: 'password',
  })
  password: string

  // 是否删除
  @Column({
    type: 'tinyint',
    name: 'isDelete',
    nullable: true,
  })
  isDelete: boolean
}
